package com.suray.attendance.model.enums.erp;

/**
 * Description: erp工作中心的枚举类
 * Author: linyu
 * Date: 2023/11/13
 */
public enum  WorkCenterEnum {

    AG30000("项目管理部"),
    AG30200("售后管理部"),
    AG40000("研发中心"),
    AG70100("下料部"),
    AG70200("机加工部"),
    AG70300("焊接部"),
    AG70405("喷塑抛丸部"),
    AG70900("包装部");

    private String workCenterName;

    WorkCenterEnum(String workCenterName) {
        this.workCenterName = workCenterName;
    }

    public String getWorkCenterName() {
        return workCenterName;
    }

    public void setWorkCenterName(String workCenterName) {
        this.workCenterName = workCenterName;
    }

    public static String getWorkCenterCodeByWorkCenterName(String erpOrder) {
        WorkCenterEnum arrObj[] = WorkCenterEnum.values();
        for (WorkCenterEnum obj : arrObj) {
            if (obj.getWorkCenterName().contains(erpOrder.substring(0,2))) { // TODO : 工作中心字符串截取等待确认
                return obj.name();
            }
        }
        return "";
    }
}
